This appendix contains listings of sample configuration files:
This sample configuration file (httpdall.cnf) contains examples of all the Internet Connection Server configuration directives.
# Sample configuration file for Web Server for OS/2 # # # # Set ServerRoot to point to the directory where you unpacked this # distribution, or wherever you want your server to have its home. # Default: <none> # Syntax: ServerRoot <path, including drive letter> # There can only be one value per keyword. # ServerRoot # # Specify the fully-qualified hostname, including the domain. You can # use an alias (if you have one set up) instead of the machine's real host # name so that clients will not be able to see the real host name. # Default: <none> # Syntax: Hostname <fully-qualified host name> # Hostname # # If you are not root you have to # use a port above 1024; good defaults are 8000, 8001, 8080 # Default value for HTTP: 80 # Syntax: Port <number> # There can only be one value per keyword. # Port 80 # # Enabling and disabling HTTP methods # Defaults: GET, HEAD, and POST are enabled, the rest are disabled # Syntax: Enable <method> # Disable <method> # Enable GET Enable HEAD Enable POST Disable SHOWMETHOD Disable CHECKIN Disable PUT Disable LINK Disable CHECKOUT Disable DELETE Disable UNLINK # # Specify the default document to be displayed to the client # when only a directory name is specified in the URL. # The first Welcome statement has precedence. # Defaults: Welcome.html, welcome.html, index.html # Syntax: Welcome <filename.html> # This directive may be defined multiple times in the # configuration file. # Welcome Frntpage.html Welcome Welcome.html #Welcome welcome.html #Welcome index.html # # Indicate if the absence of a trailing slash in the URL will # provide a directory listing or the default welcome page. # Default: On # Syntax: AlwaysWelcome <on/off> # AlwaysWelcome On # # Specify the directory where meta-information should be stored. # Default: .web # Syntax: MetaDir <directory name> # Only one keyword/value pair is allowed # MetaDir .web # # Specify the suffix for the file in which meta-information is # to be stored. Meta-information is stored in a file with the # same name as the actual document, but appended with a suffix # specified by the MetaSuffix directive. # Default: .meta # Syntax: MetaSuffix <.suffix> # Only one value per keyword, but multiple keyword/value pairs # are allowed. # MetaSuffix .meta # # When running as a proxy, set the size of the buffer. # Default: 50 K # Syntax: MaxContentLengthBuffer <size in K> # Only one keyword/value pair allowed. # MaxContentLengthBuffer 50 K # # Map suffixes to the content-type of a file. # Defaults: see list below # Syntax: Addtype <.suffix><representation><encoding><quality> # <quality> is optional # This directive may be defined multiple times in the configuration file. # AddType .mime www/mime binary 1.0 # Internal -- MIME is # not recursive AddType .bin application/octet-stream binary 1.0 # Uninterpreted binary AddType .oda application/oda binary 1.0 AddType .pdf application/pdf binary 1.0 AddType .ai application/postscript 8bit 0.5 # Adobe Illustrator AddType .PS application/postscript 8bit 0.8 # PostScript AddType .eps application/postscript 8bit 0.8 AddType .ps application/postscript 8bit 0.8 AddType .rtf application/x-rtf 7bit 1.0 # RTF AddType .csh application/x-csh 7bit 0.5 # C-shell script AddType .dvi application/x-dvi binary 1.0 # TeX DVI AddType .hdf application/x-hdf binary 1.0 # NCSA HDF data file AddType .latex application/x-latex 8bit 1.0 # LaTeX source AddType .nc application/x-netcdf binary 1.0 # Unidata netCDF data AddType .cdf application/x-netcdf binary 1.0 AddType .sh application/x-sh 7bit 0.5 # Shell-script AddType .tcl application/x-tcl 7bit 0.5 # TCL-script AddType .tex application/x-tex 8bit 1.0 # TeX source AddType .texi application/x-texinfo 7bit 1.0 # Texinfo AddType .texinfo application/x-texinfo 7bit 1.0 AddType .t application/x-troff 7bit 0.5 # Troff AddType .roff application/x-troff 7bit 0.5 AddType .tr application/x-troff 7bit 0.5 AddType .man application/x-troff-man 7bit 0.5 # Troff with man macros AddType .me application/x-troff-me 7bit 0.5 # Troff with me macros AddType .ms application/x-troff-ms 7bit 0.5 # Troff with ms macros AddType .src application/x-wais-source 7bit 1.0 # WAIS source AddType .bcpio application/x-bcpio binary 1.0 # Old binary CPIO AddType .cpio application/x-cpio binary 1.0 # POSIX CPIO AddType .gtar application/x-gtar binary 1.0 # Gnu tar AddType .shar application/x-shar 8bit 1.0 # Shell archive AddType .sv4cpio application/x-sv4cpio binary 1.0 # SVR4 CPIO AddType .sv4crc application/x-sv4crc binary 1.0 # SVR4 CPIO with CRC # # The following are neutral CAE formats: # AddType .igs application/iges binary 1.0 # IGES Graphics format AddType .iges application/iges binary 1.0 # IGES Graphics format AddType .IGS application/iges binary 1.0 # IGES Graphics format AddType .IGES application/iges binary 1.0 # IGES Graphics format AddType .stp application/STEP 8bit 1.0 # ISO-10303 STEP - AddType .STP application/STEP 8bit 1.0 # Product data files AddType .step application/STEP 8bit 1.0 AddType .STEP application/STEP 8bit 1.0 AddType .dxf application/dxf binary 1.0 # DXF (AUTODESK) AddType .DXF application/dxf binary 1.0 AddType .vda application/vda binary 1.0 # VDA-FS Surface data AddType .VDA application/vda binary 1.0 AddType .set application/set 8bit 1.0 # SET (French CAD std) AddType .SET application/set 8bit 1.0 AddType .stl application/SLA 8bit 1.0 # Stereolithography AddType .STL application/SLA 8bit 1.0 # # The following are vendor-specific CAD-formats commonly # used aCERN and in HEP institutes: # AddType .dwg application/acad binary 1.0 # Autocad drawing files AddType .DWG application/acad binary 1.0 AddType .SOL application/solids binary 1.0 # MATRA Prelude solids AddType .DRW application/drafting binary 1.0 # Prelude Drafting AddType .prt application/pro_eng binary 1.0 # PTC Pro/ENGINEER part AddType .PRT application/pro_eng binary 1.0 AddType .unv application/i-deas binary 1.0 # SDRC I-DEAS files AddType .UNV application/i-deas binary 1.0 AddType .CCAD application/clariscad binary 1.0 # ClarisCAD files AddType .snd audio/basic binary 1.0 # Audio AddType .au audio/basic binary 1.0 AddType .aiff audio/x-aiff binary 1.0 AddType .aifc audio/x-aiff binary 1.0 AddType .aif audio/x-aiff binary 1.0 AddType .wav audio/x-wav binary 1.0 # Windows+ WAVE format AddType .bmp image/bmp binary 1.0 # OS/2 bitmap format AddType .gif image/gif binary 1.0 # GIF AddType .ief image/ief binary 1.0 # Image Exchange fmt AddType .jpg image/jpeg binary 1.0 # JPEG AddType .JPG image/jpeg binary 1.0 AddType .JPE image/jpeg binary 1.0 AddType .jpe image/jpeg binary 1.0 AddType .JPEG image/jpeg binary 1.0 AddType .jpeg image/jpeg binary 1.0 AddType .tif image/tiff binary 1.0 # TIFF AddType .tiff image/tiff binary 1.0 AddType .ras image/cmu-raster binary 1.0 AddType .pnm image/x-portable-anymap binary 1.0 # PBM Anymap format AddType .pbm image/x-portable-bitmap binary 1.0 # PBM Bitmap format AddType .pgm image/x-portable-graymap binary 1.0 # PBM Graymap format AddType .ppm image/x-portable-pixmap binary 1.0 # PBM Pixmap format AddType .rgb image/x-rgb binary 1.0 AddType .xbm image/x-xbitmap 7bit 1.0 # X bitmap AddType .xpm image/x-xpixmap binary 1.0 # X pixmap format AddType .xwd image/x-xwindowdump binary 1.0 # X window dump (xwd) AddType .html text/html 8bit 1.0 # HTML AddType .htm text/html 8bit 1.0 # HTML on PCs AddType .htmls text/html 8bit 1.0 # Server-side includes AddType .c text/plain 7bit 0.5 # C source AddType .h text/plain 7bit 0.5 # C headers AddType .C text/plain 7bit 0.5 # C++ source AddType .cc text/plain 7bit 0.5 # C++ source AddType .hh text/plain 7bit 0.5 # C++ headers AddType .m text/plain 7bit 0.5 # Objective-C source AddType .f90 text/plain 7bit 0.5 # Fortran 90 source AddType .txt text/plain 7bit 0.5 # Plain text AddType .rtx text/richtext 7bit 1.0 # MIME Richtext format AddType .tsv text/tab-separated-values 7bit 1.0 # Tab-separated values AddType .etx text/x-setext 7bit 0.9 # Struct Enchanced Txt AddType .MPG video/mpeg binary 1.0 # MPEG AddType .mpg video/mpeg binary 1.0 AddType .MPE video/mpeg binary 1.0 AddType .mpe video/mpeg binary 1.0 AddType .MPEG video/mpeg binary 1.0 AddType .mpeg video/mpeg binary 1.0 AddType .qt video/quicktime binary 1.0 # QuickTime AddType .mov video/quicktime binary 1.0 AddType .avi video/x-msvideo binary 1.0 # MS Video for Windows AddType .movie video/x-sgi-movie binary 1.0 # SGI moviepalyer AddType .gz multipart/x-gzip binary 1.0 AddType .zip multipart/x-zip binary 1.0 # PKZIP AddType .tar multipart/x-tar binary 1.0 # 4.3BSD tar AddType .ustar multipart/x-ustar binary 1.0 # POSIX tar AddType *.* www/unknown binary 0.2 # Try to guess AddType * www/unknown binary 0.2 # Try to guess AddType .cxx text/plain 7bit 0.5 # C++ AddType .for text/plain 7bit 0.5 # Fortran AddType .mar text/plain 7bit 0.5 # MACRO AddType .log text/plain 7bit 0.5 # logfiles AddType .com text/plain 7bit 0.5 # scripts AddType .sdml text/plain 7bit 0.5 # SDML AddType .list text/plain 7bit 0.5 # listfiles AddType .lst text/plain 7bit 0.5 # listfiles AddType .def text/plain 7bit 0.5 # definition files AddType .conf text/plain 7bit 0.5 # definition files AddType . text/plain 7bit 0.5 # files with no extension # # Map suffixes to MIME content-encodings. # Defaults see list below # Syntax: AddEncoding <.suffix><encoding> # Each keyword will have two values. Multiple keyword/values are # AddEncoding .Z x-compress 1.0 # Compressed data AddEncoding .gz x-gzip 1.0 # # Map suffixes to the language of a document. # Default: <none> # Syntax: AddLanguage <.suffix><encoding> # There will be two values for each keyword. Multiple keyword/ # values are allowed. # Example: # AddLanguage .uk en_UK # # # Specify whether case sensitivity for suffixes is on or off. # Default: Off # Syntax: SuffixCaseSense <on/off> # Only one value per keyword is allowed; only one keyword/value # pair is allowed. # SuffixCaseSense Off # # Keyword search facility # Default: <none> # Syntax: Search <absolute pathname of search script> # One value per keyword is allowed. One keyword/value pair is # allowed. # Example: # Search c:\tcpip\cgi-bin\search.exe # # # POST requests # Default: <none> # Syntax: POST-Script <absolute pathname of post-handler> # One value per keyword is allowed. One keyword/value pair is # allowed. # Example: # POST-Script c:\tcpip\cgi-bin\post.exe # # # PUT requests # Default: <none> # Syntax: PUT-Script <absolute pathname of put-handler> # One value per keyword is allowed. One keyword/value pair is # allowed. # Example: # PUT-Script c:\tcpip\cgi-bin\put.exe # # # DELETE requests # Default: <none> # Syntax: DELETE-Script <absolute pathname of put-handler> # One value per keyword is allowed. One keyword/value pair is # allowed. # Example: # DELETE-Script c:\tcpip\cgi-bin\delete.exe # # # Enable/disable or selective directory browsing # Default: On # Syntax: DirAccess <on/off/selective> # One value per keyword is allowed. One keyword/value pair is # allowed. DirAccess On # # Configure/disable readme feature for directory browsing. # Default: top # Syntax: DirReadme <top/bottom/off> # One value per keyword is allowed. One keyword/value pair is # allowed. DirReadme top # # Control the appearance of the directory listing. # Defaults: DirShowIcons On # DirShowDate On # DirShowSize On # DirShowDescription On # DirShowBrackets On # DirShowCase On # DirShowBytes Off # Syntax: <directive> <on/off> # Only one value per keyword is allowed. Only one keyword/value # pair is allowed. # DirShowIcons On DirShowDate On DirShowSize On DirShowDescription On DirShowBrackets On DirShowCase On DirShowBytes Off # # Specify the maximum width for the description text in # directory listings. # Default: DirShowMaxDescrLength 25 # Syntax: DirShowMaxDescrLength <num> # Only one value per keyword is allowed. Only one keyword/value # pair is allowed. # DirShowMaxDescrLength 25 # # Specify the minimum width for the filename field for # directory listings. # Default: DirShowMinLength 15 # Syntax: DirShowMinLength <num> # Only one value per keyword is allowed. Only one keyword/value # pair is allowed. DirShowMinLength 15 # # Specify the maximum width for the filename field for # directory listings. # Default: DirShowMaxLength 25 # Syntax: DirShowMaxLength <num> # Only one value per keyword is allowed. Only one keyword/value # pair is allowed. # DirShowMaxLength 25 # # Logging; if you want logging, uncomment these lines and specify # locations for your access and error logs # # Default: <none> # Syntax: AccessLog <filename> # Example: # AccessLog d:\www\daemon\etc\httlog # AccessLog server_root/logs/httpd-log # # Default: <none> # Syntax: ErrorLog <filename> # Example: # ErrorLog d:\www\daemon\etc\htterr # ErrorLog server_root/logs/httpd-error # # Default: Common # Syntax: LogFormat <Old | Common> # Example: # LogFormat Common # LogFormat Common # # Default: LocalTime # Syntax: LogTime <GMT | LocalTime> # Example: # LogTime LocalTime # LogTime LocalTime # # User authentication and document protection # # Within the configuration file, there are three directives that define # file access protection: Protect, Defprot, and Protection. # # The Protection directive # defines how a set of files is to be protected, in other words, a protection set-up. # A protection set-up can be the name of a separate protect file or can be defined within the # configuration file. # # The Protect and DefProt directives define the association of a protection set-up with a set of # files to be protected. The Defprot statement associates a protection setup with a file template # but does not activate the protection. The Protect statement associates a protection set-up # with a file template and activates the protection. # # # # Protection directive: # Syntax: Protection set-up name { directives } # Within the braces, any combination of nine possible protection directives can be defined: # AuthType, ServerID, PassWdFile, GroupFile, GetMask, PutMask, PostMask, Mask, ACLOverride # Default: <none> # # # Protect directive: # Syntax: Protect template # Default: <none> # # DefProt directive: # Syntax: DefProt template setup # Default: <none> # # Example DefProt and Protect directives # # Protection setup by usernames; specify groups in the group # file "if you need groups"; create and maintain password file # with the htadm program # # Protection PROT-SETUP-USERS { # ServerId YourServersFancyName # AuthType Basic # PasswdFile /where/ever/passwd # GroupFile /where/ever/group # GET-Mask user, user, group, group, user # } # # # Protection setup by hosts; you can use both domain name # templates and IP number templates # # Protection PROT-SETUP-HOSTS { # ServerId YourServersFancyName # AuthType Basic # PasswdFile /where/ever/passwd # GroupFile /where/ever/group # GET-Mask @(*.cern.ch, 128.141.*.*, *.ncsa.uiuc.edu) # } # Defprot /very/secret/URL/* # Protect /very/secret/URL/* PROT-SETUP-USERS # Protect /another/secret/URL/* PROT-SETUP-HOSTS # Protect # # Mapping rules # # Redirect clients from one server to another when documents are # moved to another server. # Default: <none> # Syntax: <rule><template><result> # There will be two values for each keyword; multiple # keyword/values are allowed. # # The Map, Pass, Fail, Redirect and Exec rules are used for mapping from # a request URL to a physical file. The rules are applied in the order they appear in the # configuration file until a request template has been matched or until there are no more rules to apply. # The rules specify templates and a new file directory to replace # that in the request. If a request comes in and the URL of the request matches one of the mapping # rules, the rule is applied. Asterisks are used as wild cards and must appear in both the request template # and the replacement template. The Fail rule does not have a replacement template. Redirect will pass # the request on to another server and requires a full URL in the replacement template # # Examples: # Map /data/* d:\www\daemon\etc\* # Map /mess/* \www\junk\* # Map /books/stuff/* \www\daemon\docs\* # Fail /bogus/* # Fail /ddd/eee/* # Redirect /old/server/* http://new.server.loc/newpath/* # Pass /buck/* \diskx\bit\* # # INSTALLATION DEFAULTS #Exec /cgi-bin/* server_root/cgi-bin/* #Exec /admin-bin/* server_root/admin-bin/* #Pass /icons/* server_root/icons/* #Pass /Admin/* server_root/admin/* #Pass /Docs/* server_root/docs/* #Pass /* server_root/html/* # Exec # # Specify blank icon URL for directory listing # Default: default shown below # Syntax: AddBlankIcon <icon URL><ALT text> # # Specify directory icon URL for directory listing # Default: default shown below # Syntax: AddDirIcon <icon URL><ALT text> # # Specify parent directory icon URL for directory listing # Default: default shown below # Syntax: AddParentIcon <icon URL><ALT text> # # Specify unknown icon URL for directory listing # Default: default shown below # Syntax: AddUnknownIcon <icon URL><ALT text> # # Bind icon URL to a MIME content-type or content-encoding # Default: default set of icons shown below # Syntax: AddIcon <icon URL><ALT text><template> # AddBlankIcon /icons/blank.gif AddDirIcon /icons/dir.gif DIR AddParentIcon /icons/back.gif UP AddUnknownIcon /icons/unknown.gif ??? AddIcon /icons/binary.gif BIN binary AddIcon /icons/text.gif TXT text/* AddIcon /icons/image.gif IMG image/* AddIcon /icons/movie.gif MOV video/* AddIcon /icons/sound.gif AU audio/* AddIcon /icons/tar.gif TAR multipart/*tar AddIcon /icons/compress.gif CMP x-compress x-gzip # # Specify path for the standard icons included in directory listings # Default:IconPath <ServerRoot>/icons/* # Syntax: IconPath <icon directory path> # # # Timeout settings # # Time to wait for client to send request after connecting to the # server before cancelling the connection. # Default: InputTimeout 2 minutes # Syntax: InputTimeout <time-spec> # InputTimeout 2 minutes # # Time to allow for sending output to the client # Default: OutputTimeout 20 minutes # Syntax: OutputTimeout <time-spec> # OutputTimeout 20 minutes # # Time to allow for server scripts to finish. If program does not # finish within allotted time, httpd will send a TERM signal and # then a KILL signal 5 seconds later to stop the program. # Default: ScriptTimeout 5 minutes # Syntax: ScriptTimeout <time-spec> # ScriptTimeout 5 minutes # # Proxy server protection and caching directives # # # Proxy protections; if you want only certain domains to use # your proxy, uncomment these lines and specify the Mask # with hostname templates or IP number templates: # # Protection PROXY-PROT { # ServerId YourProxyName # Mask @(*.cern.ch, 128.141.*.*, *.ncsa.uiuc.edu) # } # Protect * PROXY-PROT # # Pass the URLs that this proxy is willing to forward. # Pass http:* Pass ftp:* Pass gopher:* Pass wais:* # # # Enable caching, specify cache root directory, and cache size # in megabytes # # Turn caching on or off # Default: Caching Off # Syntax: Caching <On | Off> # Caching Off # # Absolute path of the cache directory. Subdirectories will be created # for each protocol cached. # Default: <none> # Syntax: CacheRoot <directory> # Example: # CacheRoot \your\cache\root\dir # # # Maximum cache size in megabytes # Default: CacheSize 5 M # Syntax: CacheSize <size> M # CacheSize 5 M # # Maximum time to keep cache files. Files older than specified time # are removed. # Default: <none> # Syntax: CacheClean <URL template> <time-spec> # Examples: # CacheClean * 2 months # CacheClean http:* 1 week # CacheClean gopher:* 20 days # CacheClean http://*.com/* 20 days 6 hours # - # # Maximum time to keep unused cache files. Files older than specified # time are removed. # Default: <none> # Syntax: CacheUnused <URL template> <time-spec> # Examples: # CacheUnused http:* 2 weeks # CacheUnused ftp:* 1 week # CacheUnused gopher:* 1 week # # # Maximum time to keep cache files for which the server gave neither # an Expires nor a Last-Modified header. # Specify default expiry times for ftp and gopher; # NEVER specify it for HTTP, otherwise documents generated by # scripts get cached which is usually a bad thing. # # Default: <dependent on protocol> # Syntax: CacheDefaultExpiry <URL template> <time-spec> CacheDefaultExpiry ftp:* 1 day CacheDefaultExpiry gopher:* 1 day CacheDefaultExpiry http:* 0 days # # Garbage collection controls # # Enable garbage collection -- remove expired files to free up memory. # Default: Enabled whenever caching is enabled # Syntax: Gc <On | Off> # Gc Off # # Daily garbage collection time # Default: 03:00 # Syntax: GcDailyGC <military time format> # GcDailyGc 03:00 # # Amount of virtual storage in kilobytes to allocate for garbage collection # Default: 500 # Syntax: GcMemUsage <number of kilobytes> # GcMemUsage 500 # # Lower limit of size criterion for removal of cached files. All files # below this size are assigned equal size criterion priority. # All values are converted to kilobytes # Default: 200 kilobytes # Syntax: CacheLimit_1 <number of kilobytes> K # CacheLimit_1 200 K # # Upper limit of size criterion for removal of cached files. All files # above this size are assigned equal size criterion priority. # All values are converted to kilobytes # Default: 4 megabytes # Syntax: CacheLimit_2 <number of kilobytes> K # CacheLimit_2 4000 K # # URLs matching specified template will not be cached. # Default: <none> # Syntax: NoCaching <URL template> # This directive can occur multiple times within the configuration file # Example: # NoCaching http://Localhost/* # # # Only URLs matching the specified template will be cached. # Default: <none> # Syntax: CacheOnly <URL template> # This directive can occur multiple times within the configuration file # Example: # CacheOnly http://info.cern.ch/* # # # Proportion of a file's age (LastModified) to be used as the expiry time. # This is used to determine expiry time when a remote server # does not specify an Expires header. For instance, if a file is # 1 month old and CacheLastModifiedFactor was set to 0.5, the file # would expire in approximatley 15 days. # Default: 0.1 # Syntax: CacheLastModifiedFactor <proportion> # CacheLastModifiedFactor 0.1 # # Interval of time until document expiry within which document will # not be cached. By default, no document expiring within 2 minutes # will be cached. # Default: 2 minutes # Syntax: CacheTimeMargin <time margin> # CacheTimeMargin 2 minutes # # Set proxy to standalone mode so that only documents found in cache # are returned. Files not in cache will return an error rather than # connecting to other servers. This setting is typically used with # expiry checking disabled. # Default: Off # Syntax: CacheNoConnect <On | Off> # CacheNoConnect Off # # Set expiry checking to on if you do not want to return an expired # document. If it is desirable to have the proxy always return # documents from cache (e.g., for demos), expiry checking can be turned # off. # Default: On # Syntax: CacheExpiryCheck <On | Off> # CacheExpiryCheck On # # Amount of time after which a cache lock can be broken. Cache # files are locked during retrieval. The lock timeout ensures # that a file will not be locked indefinitely should a retrieval fail. # NOTE: CacheLockTimeOut should never be less that OutPutTimeOut. # Default: 20 minutes # Syntax: CacheLockTimeOut <time-spec> # CacheLockTimeOut 20 minutes # # Path and name of file that contains a log of all document requests. # The value can be either an absolute path or a path relative to # ServerRoot (one example shown of each) # Default: <none> # Syntax: CacheAccessLog <file path> # Examples: # CacheAccessLog /absolute/path/logfile # CacheAccessLog logs/logfile # # # Configuring Proxy to Connect To Another Proxy # # HTTP proxy server that the server should contact for HTTP requests # if the server being configured is part of a chain of proxies. # Default: <none> # Syntax: http_proxy <URL> # # FTP proxy server that the server should contact for FTP requests # if the server being configured is part of a chain of proxies. # Default: <none> # Syntax: ftp_proxy <URL> # # Gopher proxy server that the server should contact for Gopher requests # if the server being configured is part of a chain of proxies. # Default: <none> # Syntax: gopher_proxy <URL> # # WAIS proxy server that the server should contact for WAIS requests # if the server being configured is part of a chain of proxies. # Default: <none> # Syntax: wais_proxy <URL> # # A list of Internet addresses or domains from which the server should # retrieve resources directly rather than going through a proxy. # Default: <none> # Syntax: no_proxy <template> # Examples: # http_proxy http://outer.proxy.server/ # ftp_proxy http://outer.proxy.server/ # gopher_proxy http://outer.proxy.server/ # wais_proxy http://outer.proxy.server/ # no_proxy 192.168.*.*,192.168.*.*:8080 # # # Suppress access log entries for host matching a given IP address or # hostname. Wild cards "*" may be used. This directive may be used # multiple times within the configuration file. # Default: <none> # Syntax: NoLog <hostnames and IP addresses> # Examples: # NoLog 128.141.*.* # NoLog *.location.company.com # Nolog *.*.*.com # NoLog *.ch *.fr *.it # # Performance directives. # # MinActiveThreads directive: # Syntax: MinActiveThreads n # Default: 20 # Note: Increase this number if you think your server will always be # busy. # MinActiveThreads 20 # # MaxActiveThreads directive: # Syntax: MaxActiveThreads n # Default: 40 # Note: Increase this number if you have a fast machine. Use a smaller # number for a slow machine. # MaxActiveThreads 40 # # IdleThreadsTimeout directive: # Syntax: IdleThreadsTimeout n # Default: forever # Note: This is the amount of time the server keeps idle threads. # If your server load isn't always high, set this to something other # than Off. With the Off setting, the server never closes idle threads. IdleThreadTimeout forever # # ServerPriority directive: # Syntax: MaxActiveThreads 0|1|2 # Default: 2 # Note: This is the priority class on you system you want your server to run. # 0 - normal process (no priority) # 1 - maximum priority as a normal process # 2 - maximum priority as a server foreground process. ServerPriority 1
This sample configuration file (httpdch.cnf) defines a proxy server with caching turned on.
# Set ServerRoot to point to the directory where you unpacked this # distribution, or wherever you want your server to have its home. # Default value: <none> # Syntax: ServerRoot <path, including drive letter> # There can only be one value per keyword. # ServerRoot # # Specify the fully-qualified hostname, including the domain. You can # use an alias (if you have one set up) instead of the machine's real host # name so that clients will not be able to see the real host name. # Default value: none. # Syntax: Hostname <fully-qualified host name> # Hostname # # If you are not root you have to # use a port above 1024; good defaults are 8000, 8001, 8080 # Default value for HTTP: 80 # Syntax: Port <number> # There can only be one value per keyword. # Port 80 # # Logging; if you want logging, uncomment these lines and specify # locations for your access and error logs # # AccessLog d:\www\daemon\etc\httlog # ErrorLog d:\www\daemon\etc\htterr # LogFormat Common # LogTime LocalTime # # Proxy server protection and caching directives # # Proxy protections; if you want only certain domains to use # your proxy, uncomment these lines and specify the Mask # with hostname templates or IP number templates: # # Protection PROXY-PROT { # ServerId YourProxyName # Mask @(*.cern.ch, 128.141.*.*, *.ncsa.uiuc.edu) # } # Protect * PROXY-PROT # # Pass the URLs that this proxy is willing to forward. # Pass http:* Pass ftp:* Pass gopher:* Pass wais:* # # Enable caching, specify cache root directory, and cache size # in megabytes # # Turn caching on or off # Default: Caching On # Syntax: Caching <On | Off> Caching On # # Absolute path of the cache directory. Subdirectories will be created # for each protocol cached. # Default: <no default> # Syntax: CacheRoot <directory> # CacheRoot \your\cache\root\dir # # Maximum cache size in megabytes # Default: CacheSize 5 M # Syntax: CacheSize <size> M CacheSize 5 M # # Maximum time to keep cache files. Files older than specified time # are removed. # Default: <no default> # Syntax: CacheClean <URL template> <time-spec> # Examples: # CacheClean * 2 months # CacheClean http:* 1 week # CacheClean gopher:* 20 days # CacheClean http://*.com/* 20 days 6 hours # # Maximum time to keep unused cache files. Files older than specified # time are removed. # Default: <no default> # Syntax: CacheUnused <URL template> <time-spec> # Examples: # CacheUnused http:* 2 weeks # CacheUnused ftp:* 1 week # CacheUnused gopher:* 1 week # # Maximum time to keep cache files for which the server gave neither # an Expires nor a Last-Modified header. # Specify default expiry times for ftp and gopher; # NEVER specify it for HTTP, otherwise documents generated by # scripts get cached which is usually a bad thing. # # Default: <dependent on protocol> # Syntax: CacheDefaultExpiry <URL template> <time-spec> CacheDefaultExpiry ftp:* 10 days CacheDefaultExpiry gopher:* 2 days # # Garbage collection controls # # Enable garbage collection -- remove expired files to free up memory. # Default: Enabled whenever caching is enabled # Syntax: Gc (On | Off> Gc On # # Daily garbage collection time # Default: 03:00 # Syntax: GcDailyGC <military time format> GcDailyGc 03:00 # # Amount of virtual storage in kilobytes to allocate for garbage collection # Default: 500 # Syntax: GcMemUsage <number of kilobytes> GcMemUsage 500 # # Lower limit of size criterion for removal of cached files. All files # below this size are assigned equal size criterion priority. # All values are converted to kilobytes # Default: 200 kilobytes # Syntax: CacheLimit_1 <number of kilobytes> K CacheLimit_1 200 k # # Upper limit of size criterion for removal of cached files. All files # above this size are assigned equal size criterion priority. # All values are converted to kilobytes # Default: 4 megabytes # Syntax: CacheLimit_1 <number of kilobytes> K CacheLimit_2 4000 k # # URLs matching specified template will not be cached. # Default: none # Syntax: NoCaching <URL template> # This directive can occur multiple times within the configuration file NoCaching http://Localhost/* # # Only URLs matching the specified template will be cached. # Default: none # Syntax: CacheOnly <URL template> # This directive can occur multiple times within the configuration file CacheOnly http://info.cern.ch/* # # Proportion of a file's age (LastModified) to be used as the expiry time. # This is used files to determine expiry time when a remote server # does not specify an Expires header. For instance, if a file is # 1 month old and CacheLastModifiedFactor was set to 0.5, the file # would expire in approximatley 15 days. # Default: 0.1 # Syntax: CacheLastModifiedFactor <proportion> CacheLastModifiedFactor 0.1 # # Remove expired files from cache only after entire cache is used up. # This value overrides garbage collection, which removes files # when they expire. Garbage collection decreases the efficiency of # of conditional GET requests, however. # Default: On # Syntax: KeepExpired <On | Off> KeepExpired On # # Cache refresh interval for URLs matching a given pattern. This # directive will cause http to check that file is still up-to-date # if refresh interval has passed. The check is performed at # the time the document is next requested after the interval has # elapsed. # Default: none # Syntax: CacheRefreshInterval <URL template><refresh interval> # examples: CacheRefreshInterval http://www.w3.org/httpd/* 1 day CacheRefreshInterval http://www.w3.org/* 11 hours CacheRefreshInterval http://www.w3/* 1 week # # Interval of time until document expiry within which document will # not be cached. By default, no document expiring within 2 minutes # will be cached. # Default: 2 minutes # Syntax: CacheTimeMargin <time margin> CacheTimeMargin 2 minutes # # Set proxy to standalone mode so that only documents found in cache # are returned. Files not in cache will return an error rather than # connecting to other servers. This setting is typically used with # expiry checking disabled. # Default: Off # Syntax: CacheNoConnect <On | Off> CacheNoConnect Off # # Set expiry checking to on if you do not want to return an expired # document. If it is desirable to have the proxy always return # documents from cache (e.g., for demos), expiry checking can be turned # off. # Default: On # Syntax: CacheExpriryCheck <On | Off> CacheExpiryCheck On # # Amount of time after which a cache lock can be broken. Cache # files are locked during retrieval. The lock timeout ensures # that a file will not be locked indefinitely should a retrieval fail. # NOTE: CacheLockTimeOut should never be less that OutPutTimeOut. # Default: 20 minutes # Syntax: CacheLockTimeOut <time-spec> CacheLockTimeOut 20 minutes # # Path and name of file that contains a log of all document requests. # The value can be either an absolute path or a path relative to # ServerRoot (one example shown of each) # Default: No default # Syntax: CacheAccessLog <file path> # Examples: # CacheAccessLog /absolute/path/logfile # CacheAccessLog logs/logfile
This sample configuration file (httpdnch.cnf) defines a proxy server with caching turned off.
# Set ServerRoot to point to the directory where you unpacked this # distribution, or wherever you want your server to have its home. # Default value: <none> # Syntax: ServerRoot <path, including drive letter> # There can only be one value per keyword. # ServerRoot # # Specify the fully-qualified hostname, including the domain. You can # use an alias (if you have one set up) instead of the machine's real host # name so that clients will not be able to see the real host name. # Default value: none. # Syntax: Hostname <fully-qualified host name> # Hostname # # If you are not root you have to # use a port above 1024; good defaults are 8000, 8001, 8080 # Default value for HTTP: 80 # Syntax: Port <number> # There can only be one value per keyword. # Port 80 # # Logging; if you want logging, uncomment these lines and specify # locations for your access and error logs # # AccessLog d:\www\daemon\etc\httlog # ErrorLog d:\www\daemon\etc\htterr # LogFormat Common # LogTime LocalTime # # Proxy server protection and caching directives # # # Proxy protections; if you want only certain domains to use # your proxy, uncomment these lines and specify the Mask # with hostname templates or IP number templates: # # Protection PROXY-PROT { # ServerId YourProxyName # Mask @(*.cern.ch, 128.141.*.*, *.ncsa.uiuc.edu) # } # Protect * PROXY-PROT # # # Pass the URLs that this proxy is willing to forward. # Pass http:* Pass ftp:* Pass gopher:* Pass wais:*
This sample configuration file (httpdacl.cnf) has access control built into it.
# Set ServerRoot to point to the directory where you unpacked this # distribution, or wherever you want your server to have its home. # Default value: <none> # Syntax: ServerRoot <path, including drive letter> # There can only be one value per keyword. # ServerRoot # # Specify the fully-qualified hostname, including the domain. You can # use an alias (if you have one set up) instead of the machine's real host # name so that clients will not be able to see the real host name. # Default value: none. # Syntax: Hostname <fully-qualified host name> # Hostname # # If you are not root you have to # use a port above 1024; good defaults are 8000, 8001, 8080 # Default value for HTTP: 80 # Syntax: Port <number> # There can only be one value per keyword. # Port 80 # # Enabling and disabling HTTP methods # Defaults: GET, HEAD, and POST are enabled, the rest are disabled # Syntax: Enable <method> Disable <method> Enable GET Enable HEAD Enable POST # # Specify the default document to be displayed to the client # when only a directory name is specified in the URL. # The first Welcome statement has precedence. # Defaults: Welcome.html, welcome.html, index.html # Syntax: Welcome <filename.html> # This directive may be defined multiple times in the # configuration file. Welcome Welcome.html Welcome welcome.html Welcome index.html # # Indicate if the absence of a trailing slash in the URL will # provide a directory listing or the default welcome page. # Default: On # Syntax: AlwaysWelcome <on/off> AlwaysWelcome On # # Indicate user-supported directories # Default: <none> # Syntax: UserDir <directory name> # This directive may be defined multiple time in the # configuration file. UserDir public_html # # Logging; if you want logging, uncomment these lines and specify # locations for your access and error logs # # AccessLog d:\www\daemon\etc\httlog # ErrorLog d:\www\daemon\etc\htterr # LogFormat Common # LogTime LocalTime # # User authentication and document protection # # Within the configuration file, there are three directives that define # file access protection: Protect, Defprot, and Protection. # # The Protection directive defines how a set of files is to be protected, # in other words, a protection set up. # A protection setup can be the name of a separate protect file or # can be defined within the configuration file. # # The Protect and DefProt directives define the association of a protection # setup with a set of files to be protected. The Defprot statement associate # a protection setup with a file template but does not activate the protectio # The Protect statement associates a protection setup # with a file template and activates the protection. # # Protection directive: # Syntax: Protection setup name { directives } # Within the braces, define nine possible protection directives: # AuthType, ServerID, PassWdFile, GroupFile, GetMask, PutMask, PostMask, # Mask, ACLOverride # Default: <none> # # Protect directive: # Syntax: Protect template # # Default: <none> # # DefProt directive: # Syntax: DefProt template setup # Default: <none> # # Example DefProt and Protect directives # # Protection setup by usernames; specify groups in the group # file "if you need groups"; create and maintain password file # with the htadm program # # Protection PROT-SETUP-USERS { # UserId nobody # GroupId nogroup # ServerId YourServersFancyName # AuthType Basic # PasswdFile /where/ever/passwd # GroupFile /where/ever/group # GET-Mask user, user, group, group, user # } # # Protection setup by hosts; you can use both domain name # templates and IP number templates # # Protection PROT-SETUP-HOSTS { # UserId nobody # GroupId nogroup # ServerId YourServersFancyName # AuthType Basic # PasswdFile /where/ever/passwd # GroupFile /where/ever/group # GET-Mask @(*.cern.ch, 128.141.*.*, *.ncsa.uiuc.edu) # } # Defprot /very/secret/URL/* # Protect /very/secret/URL/* PROT-SETUP-USERS # Protect /another/secret/URL/* PROT-SETUP-HOSTS # # Mapping rules # # Redirect clients from one server to another when documents are # moved to another server. # Default: <none> # Syntax: <rule><template><result> # There will be two values for each keyword; multiple # keyword/values are allowed. # # The Map, Pass, Fail, Redirect and Exec rules are used for mapping from # a request URL to a physical file. The rules are applied in the order # they appear in the configuration file until a request template has been mat # until there are no more rules to apply. # The rules specify templates and a new file directory to replace # that in the request. If a request comes in and the URL of the request # matches one of the mapping rules, the rule is applied. # Asterisks are used as wild cards and must appear in both the request templa # and the replacement template. The Fail rule does not have a replacement te # Redirect will pass the request on to another server and requires a full # URL in the replacement template. # # Examples: # Map /data/* d:\www\daemon\etc\* # Map /mess/* \www\junk\* # Map /books/stuff/* \www\daemon\docs\* # Fail /bogus/* # Fail /ddd/eee/* # Redirect /old/server/* http://new.server.loc/newpath/* # Pass /buck/* \diskx\bit\* # Exec /cgibin/* \www\cgi-bin\*